import { defineStore } from 'pinia';

export const useUserStore = defineStore('user', {
  state: () => ({
    userInfo: null
  }),
  actions: {
    setUserInfo(userData) {
      this.userInfo = userData;
    },
    clearUserInfo() {
      this.userInfo = null;
    }
  },
  persist: {
    storage: sessionStorage,
  }
});